import gtk
import gtk.glade

class memobee_tray:
	'''
	The popupXML signals are:
		launchers
		notes
		about
		quit --> connected to gtk.main_quit
	'''	
	def onActivate(self,status_icon, button, activate_time):
		self.popup.popup(None, None, None, button, activate_time)
		
	def __init__(self,image):
		self.icon = image
		self.status_icon = gtk.StatusIcon()
		self.status_icon.set_from_file(self.icon)
		self.popupXML = gtk.glade.XML('popup_menu.glade')
		self.popup = self.popupXML.get_widget('memobee_menu')
		
		self.status_icon.connect_object('popup-menu',self.onActivate,self.popup)
		self.popupXML.signal_autoconnect({"quit":gtk.main_quit})
